package com.example.validdemo.annotation.demo;

/**
 * @author shenhan
 * @create 2020/1/19 15:51
 * @description
 */
@Person
public class PersonAnnotationImpl {
    public static void printDemo(Class c) {
        System.out.println(c.getName());
        final Person person = (Person) c.getAnnotation(Person.class);
        if (person != null) {
            System.out.println("name:" + person.name() + " age:" + person.age());
        } else {
            System.out.println("person unknown!");
        }
    }

    public static void main(String[] args) {
        printDemo(PersonAnnotationImpl.class);
    }
}
